package mks.webshop.entity;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;


@SuppressWarnings("serial")
@PersistenceCapable
public class OrderDetail extends BaseEntity implements Serializable{

	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private long key;
	
	private String orderCode;
	
	@Persistent
	private String productCode;
	
	@Persistent
	private String productName;
	
	@Persistent
	private int quantity;
	
	@Persistent
	private int maxQuantity;
	
	@Persistent 
	private long unitPrice;
	
	@Persistent
	private String unit;
	
	@Persistent
	private long price;
	
	@Persistent
	private Date created;
	
	@Persistent
	private String createdBy;
	
	@Persistent
	private Date lastModified;
	
	@Persistent
	private String lastModifiedBy;
	
	public OrderDetail(){}
	
	public OrderDetail(String orderCode, String productCode, String productName, int quantity, int maxQuantity, String unit, long unitPrice, long price){
		this.orderCode = orderCode;
		this.productCode = productCode;
		this.productName = productName;
		this.quantity = quantity;
		this.maxQuantity = maxQuantity;
		this.unit = unit;
		this.unitPrice = unitPrice;
		this.price = price;
	}
	
	public long getKey() {
		return key;
	}

	public void setKey(long key) {
		this.key = key;
	}

	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public int getQuantity() {
		return quantity;
	}
	
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public int getMaxQuantity() {
		return maxQuantity;
	}

	public void setMaxQuantity(int maxQuantity) {
		this.maxQuantity = maxQuantity;
	}

	
	public long getPrice() {
		return price;
	}

	public void setPrice(long price) {
		this.price = price;
	}

	@Override
	public Date getCreated() {
		return this.created;
	}

	@Override
	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public String getCreatedBy() {
		return this.createdBy;
	}

	@Override
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
		
	}

	@Override
	public Date getLastModified() {	
		return this.lastModified;
	}

	@Override
	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}

	@Override
	public String getLastModifiedBy() {
		return this.lastModifiedBy;
	}

	@Override
	public void setLastModifiedBy(String lastModifiedBy) {
		this.lastModifiedBy = lastModifiedBy;
	}

	public String getOrderCode() {
		return orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}
	
	public long getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(long unitPrice) {
		this.unitPrice = unitPrice;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
}
